<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>用户登录</title>
    <link rel="stylesheet" type="text/css" href="pages/bootstrap.min.css">
    <script src="js/index2.js" type="text/javascript"></script>
    <style>
        body {
            background: url(img/8.gif)  ;
        }
        section {
            width: 280px;
            margin: 0 auto;
        }
        h2 {
            font-size: 24px;
            padding-left: 10px;
        }
        form {
            width: 240px;
            border: 1px dotted #999;
            padding: 1px 6px 1px 16px;
            margin: 10px;
            font: 14px Arial;
        }

        span { /* 统一定义表单上的文字描述 */
            display: inline-block;
            width: 100px;
            padding-right: 20px;
            text-align: left;
        }

        input {      /* 所有input标记 */
            color: #00008B;
        }

        input[type="text"], input[type="password"] { /* 属性选择器*/
            width: 100px;
            background-color: #ADD8E6;
            border: none;
            border-bottom: 1px solid #266980;
            color: #1D5061;
        }

        input[type="button"] {  /* 属性选择器 */
            border: 1px outset #00008B;
            padding: 1px 2px 1px 2px;
            margin: 0 10px;
        }

        select {
            width: 100px;
            color: #00008B;
            background-color: #ADD8E6;
            border: 1px solid #00008B;
        }
    </style>
    <style>
        body{
            font-family: Arial, Helvetica, sans-serif;
            font-size: 17px;
            line-height: 1.6;
        }
        .button{
            border: 0;    /* 去除原button边框样式 */
            background-color: coral;
            color: #fff;
            padding: 1em 2em;
        }
        .button:hover{
            background-color: #333;
        }
        .modal{
            display: none;
            position: fixed;
            z-index: 1;
            left: 0;
            top: 0;
            height: 100%;
            width: 100%;
            overflow: hidden;
            background-color: rgba(0, 0, 0,0.5);
        }
        .modal-content{
            align-content: center;
            background-color: #00008B;
            margin: 15% auto;
            width:1200px;
            height:500px;
            box-shadow: 0 5px 8px 0 rgba(0, 0, 0,0.2), 0 7px 20px 0 rgba(0, 0, 0,0.2);
            animation-name: modalopen;
            animation-duration: 1s;
        }
        .modal-header h2,.modal-footer h3{
            margin: 0;
        }

        .closeBtn{
            background: darkblue;
            color:#f4f4f4;
            float: right;
            font-size: 43px;
            margin-left: 46%;
        }
        .closeBtn:hover,.closeBtn:focus{
            color: #000;
            text-decoration: none;
            cursor: pointer;

        }
        @keyframes modalopen{
            from {opacity: 0}
            to {opacity: 1}
        }
    </style>
</head>
<body onload="window_onload()">
<section>
    <h1>用户登录</h1>

    <form>
        <p style="font-size: 25px"><span >用户：</span><input type="text" id="txtName" autofocus required class="form-control" style="width: 100%"/></p>
        <p style="font-size: 25px"> <span >密码：</span><input type="password" id="txtPwd"  required class="form-control" style="width: 100%"/></p>
        <p></p>
        <input type="button" name="btnLogin" id="btnLogin" value="登录"
               onclick="javascript:btnLogin_onclick();"/>
        <input type="button" name="btnRegister" id="modalBtn" value="注册"/>
        <input type="button" name="btnClear" id="btnClear" value="重置"
               onclick="btnClear_onclick();"/>
        <p></p>
        <hr>
        <p><span></span><p id="funcid" disabled onchange="window.location=this.value;">
    </p></p>
        <br/>
        <button type="button" class="btn btn-default" style="margin-left: 20%"><a href="index.html" style="text-decoration-line: none">转到管理员登录</a></button>
    </form>
    <!-- 弹框部分 -->
    <div id="simpleModal" class="modal">
        <div class="modal-content">
            <span class="closeBtn">close</span>
            <iframe src="./pages/zhuce.html" width="1200px" height="500px" align="center"></iframe>
        </div>
    </div>

    <script>
        // 获取弹窗元素
        var modal = document.getElementById("simpleModal");

        // 获取按钮元素
        var modalBtn = document.getElementById("modalBtn");

        // 获取关闭弹窗按钮元素
        var closeBtn = document.getElementsByClassName("closeBtn")[0];

        // 监听打开弹窗事件
        modalBtn.addEventListener("click",openModal);

        // 监听关闭弹窗事件
        closeBtn.addEventListener("click",closeModal);

        // 监听window关闭弹窗事件
        window.addEventListener("click",outsideClick);

        // 弹窗事件
        function openModal () {
            modal.style.display = "block";
        }

        // 关闭弹框事件
        function closeModal () {
            modal.style.display = "none";
        }

        // outsideClick
        function outsideClick (e) {
            if(e.target == modal){
                modal.style.display = "none";
            }
        }
    </script>
</section>
</body>
</html>